<template>
	<view class="theme-page-bg h100vh padding-20 containear">
		<template v-show="msgList.length > 0">
			<view v-for="(item, index) in msgList" :key="index">
				<MsgItem :dataItem="item" />
			</view>
		</template>
		<empty v-show="msgList.length == 0" mode="message" :show="false"/>
		<bottom type="accompany" :tabIndex="2"></bottom>
	</view>
</template>

<script setup lang="ts">
	import empty from '@/components/empty/index.vue';
	import MsgItem from './components/msgItem/index.vue';
	import bottom from '@/components/footer/footer.vue';
	import { ref, onMounted, getCurrentInstance } from 'vue';
	
	const { proxy } = getCurrentInstance() as any;
	const msgList = ref([])
	
	const getList = () => {
		const url = proxy.$API.getNoticeMessages;
		proxy.$UNIHTTP.getData(url, {}).then((res: any) => {
			if (res.code == 1) {
				msgList.value = res.data;
			} 			
		})
	}
	
	onMounted(() => {
		getList();
	})
	
</script>

<style lang="scss" scoped>
	.containear {
		overflow-x: scroll;
		padding-bottom: 120rpx;
	}
</style>